package com.itheima.manager.service.imp;

import com.itheima.manager.mapper.ContactMapper;
import com.itheima.manager.service.IDeleteService;
import com.itheima.manager.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

public class DeleteServiceImp  implements IDeleteService {
    @Override
    public void detete(Integer id) {
        SqlSession session = SqlSessionUtil.getSession();
        ContactMapper mapper = session.getMapper(ContactMapper.class);
        mapper.detete(id);
        session.commit();
        session.close();
    }
}
